#pragma once
// SnakeSView.h : interface of the CSnakeSView class
//
#include "SnakeSDoc.h"
class Snake;
class Food;

class CSnakeSView : public CView
{
protected: // create from serialization only
	CSnakeSView();
	DECLARE_DYNCREATE(CSnakeSView)

	// Attributes
public:
	CSnakeSDoc* GetDocument() const;

	// Operations
public:
	int speed;
	Snake* pSnake;
	int score;
	Food* food;
	int direct;
	int lastDirect;
	void createFood(void);
	// Overrides
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

	// Implementation
public:
	virtual ~CSnakeSView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

	// Generated message map functions
protected:
	afx_msg void OnFilePrintPreview();
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void OnInitialUpdate();
	afx_msg void OnMenuStart();
	Snake* getSnake(void);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};

#ifndef _DEBUG  // debug version in SnakeSView.cpp
inline CSnakeSDoc* CSnakeSView::GetDocument() const
{ return reinterpret_cast<CSnakeSDoc*>(m_pDocument); }
#endif

